package com.tidc.seaserverweb.controller;

import com.tidc.seaservermodel.dto.UserDto;
import com.tidc.seaservermodel.entity.Fres;
import com.tidc.seaserverservice.service.VueService;
import org.springframework.security.core.Authentication;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;


@RestController
//@CrossOrigin(origins = "*",maxAge = 3600,allowCredentials = "true")
public class VueController {
    @Resource
    private VueService vueService;
    @GetMapping("/menus")
    public Fres<UserDto> getMenu(Authentication authentication){
        return vueService.getMenu(authentication);
    }
    @GetMapping("/test")
    @Transactional
    public Integer test(){
        return 2000;
    }
}
